﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace LevelEditor.App.Serialization
{
    public class SBehavior
    {

        private int id;
        [XmlElement("IdBehavior")]
        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        private string nameBehavior;
        [XmlElement("NameBehavior")]
        public string NameBehavior
        {
            get { return nameBehavior; }
            set { nameBehavior = value; }
        }

        private bool isWalk;
        [XmlElement("IsWalk")]
        public string IsWalk
        {
            get { return isWalk.ToString(); }
            set
            {
                string v = value;
                isWalk = Boolean.Parse(value);
            }
        }

        private string spriteSheet;
        [XmlElement("SpriteSheet")]
        public string SpriteSheet
        {
            get { return spriteSheet; }
            set { spriteSheet = value; }
        }

        [XmlArray("Images")]
        [XmlArrayItem("Image")]
        public List<string> images;

        private int idProjDialog;
        [XmlElement("IdProjDialog")]
        public int IdProjDialog
        {
            get { return idProjDialog; }
            set { idProjDialog = value; }
        }

        private SWaypointCollection waypoints;
        [XmlElement("WaypointCollection")]
        public SWaypointCollection Waypoints
        {
            get { return waypoints; }
            set { waypoints = value; }
        }

        [XmlArray("CollisionMap")]
        [XmlArrayItem("CollisionData")]
        public List<SCollisionData> CollisionMap;

        private int durationTime;
        [XmlElement("DurationTime")]
        public int DurationTime
        {
            get { return durationTime; }
            set { durationTime = value; }
        }

    }
}
